package com.steven.springbootrabbitmq.consumer;

import com.steven.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author liuxiangyu
 * @date 2021-07-06 22:41
 */
@Slf4j
@Component
public class ConfirmConsumer {
    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void receiveConfirmMsg(Message message) {
        String msg = new String(message.getBody());
        log.info("接收到来自队列{}的消息：{}", ConfirmConfig.CONFIRM_QUEUE_NAME, msg);
    }
}
